<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head>
  <meta charset="UTF-8">
  <title>Товар</title>
  <link rel="icon" href="/image/logo2.jpg" type="image/x-icon">
  <link rel="shortcut icon" href="/image/logo2.jpg" type="image/x-icon">
  <link rel="stylesheet" th:href="@{/main.css}">
  <meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>

<div th:replace="~{layouts/header :: header}"></div>

<main class="container">

  <img class="full_order" id="full_order_img" th:src="${order.img}" alt="Извините, фото не найдено">
  <br><br><br>
  <div id="edit-btn-center">
    <form class="edit-btn" th:action="@{'/orders/' + ${order.id} + '/delete'}" method="post" sec:authorize="hasAuthority('ADMIN') || hasAuthority('DEVELOPER')">
      <button>Удалить</button>
    </form>

    <form class="edit-btn" th:action="@{'/orders/' + ${order.id} + '/update'}" sec:authorize="hasAuthority('ADMIN') || hasAuthority('DEVELOPER')">
      <button>Редактировать</button>
    </form>

    <form class="edit-btn" th:action="@{'/orders/' + ${order.id} + '/basket'}" method="post" sec:authorize="hasAuthority('DEVELOPER') || hasAuthority('USER')">
      <button>Добавить в корзину</button>
    </form>
  </div>

  <h1 class="full_order" th:text="${order.name}"/>
  <br><br><br>
  <h1 class="full_order" th:text="${order.price} + ' ₽'"/>
  <br><br>
  <h4 class="full_order" th:text="'Производитель: ' + ${order.manufacturer}"/>
  <h4 class="full_order" th:text="'Произведено в: ' + ${order.country_of_manufacture}"/>
  <br><br><br>
  <h2 class="full_order" th:text="${order.description}"/>
  <hr class="hr_index" id="hr" sec:authorize="hasAuthority('ADMIN') || hasAuthority('DEVELOPER')">
  <h3 class="full_order" th:text="'Годен до: ' + ${order.expiration_date}" sec:authorize="hasAuthority('ADMIN') || hasAuthority('DEVELOPER')"/>
  <h3 class="full_order" th:text="'Закупочная цена: ' + ${order.purchase_price}" sec:authorize="hasAuthority('ADMIN') || hasAuthority('DEVELOPER')"/>
  <h3 class="full_order" th:text="'В наличие: ' + ${order.quantity}" sec:authorize="hasAuthority('ADMIN') || hasAuthority('DEVELOPER')"/>
  <h3 class="full_order" th:text="'Ключевое слово: ' + ${order.purpose_of_use}" sec:authorize="hasAuthority('ADMIN') || hasAuthority('DEVELOPER')"/>
  <h3 class="full_order" th:text="'Код товара: ' + ${order.code}" sec:authorize="hasAuthority('ADMIN') || hasAuthority('DEVELOPER')"/>



</main>

<div th:replace="~{layouts/footer :: footer}"></div>

</body>
</html>